<!-- -----------------------------------------------------------------
-
- Copyright (C) 2019 OSGeo
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
---------------------------------------------------------------------- -->

{% load i18n avatar_tags %}
{% load static from staticfiles %}
{% load account socialaccount %}
{% load base_tags %}
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta Http-Equiv="Cache-Control" Content="no-cache">
    <meta Http-Equiv="Pragma" Content="no-cache">
    <meta Http-Equiv="Expires" Content="0">
    <meta Http-Equiv="Pragma-directive: no-cache">
    <meta Http-Equiv="Cache-directive: no-cache">

    <title>{% block title %}{{ SITE_NAME }}{% endblock %}</title>

    <link rel="shortcut icon" href="{% static 'geonode/img/favicon.ico' %}" />
    <link href="{% static "lib/css/ol.css" %}" rel="stylesheet" />
    <script src="{% static "lib/js/ol.js" %}"></script>
    <link rel="preload" as="style" href="{% static "geonode/css/font-awesome.min.css" %}" />
    <link rel="preload" as="font" href="{% static "geonode/fonts/lato_regular.ttf" %}" crossorigin="" />
    <link rel="preload" as="font" href="{% static "geonode/fonts/lato_bold.ttf" %}" crossorigin="" />
    <link rel="preload" as="font" href="{% static "geonode/fonts/lato_light.ttf" %}" crossorigin="" />

    {% block head %}

      {% if DEBUG_STATIC %}
          <link href="{% static "lib/css/jquery.dataTables.css" %}" rel="stylesheet" />
          <link href="{% static "lib/css/select2.css" %}" rel="stylesheet"/>
          <link href="{% static "lib/css/bootstrap.css" %}" rel="stylesheet"/>
          <link href="{% static "lib/css/bootstrap-treeview.css" %}" rel="stylesheet"/>
          <link href="{% static "lib/css/jquery-ui.theme.min.css" %}" rel="stylesheet"/>
          <link href="{% static "lib/css/jquery-ui.structure.min.css" %}" rel="stylesheet"/>
          <link href="{% static "lib/css/bootstrap-treeview.css" %}" rel="stylesheet"/>
      {% else %}
      <link href="{% static "lib/css/assets.min.css" %}" rel="stylesheet"/>
      {% endif %}
      <link href="{% static "geonode/css/base.css" %}" rel="stylesheet"/>
      <link rel='stylesheet' id='cookie-law-info-css'  href="{% static "geonode/css/cookie-law-info/cookie-law-info-public.css" %}" type='text/css' media='all' />
      <link rel='stylesheet' id='cookie-law-info-gdpr-css'  href="{% static "geonode/css/cookie-law-info/cookie-law-info-gdpr.css" %}" type='text/css' media='all' />
      <style type="text/css">[ng\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}</style>
      <style type="text/css">
        /* Additional styles by custom themes */
        {% if custom_theme.body_color %}
        body {
          background: {{ custom_theme.body_color }};
          {% if custom_theme.body_text_color %}
          color: {{ custom_theme.body_text_color }};
          {% endif %}
        }

        .home #partners {
          background: {{ custom_theme.body_color }};
          padding: 2em 0;
          text-align: center;
        }
        {% endif %}

        {% if custom_theme.navbar_color %}
        .home .navbar-inverse , .navbar-inverse {
          background-color: {{ custom_theme.navbar_color }};
        }
        {% endif %}

        {% if custom_theme.navbar_text_color %}
        .navbar-inverse .navbar-nav > li > a {
          color: {{ custom_theme.navbar_text_color }};
          font-weight: 600;
          padding-top: 25px;
          padding-bottom: 25px;
        }
        {% endif %}

        {% if custom_theme.navbar_text_hover %}
        .navbar-inverse .navbar-nav > li > a:hover {
          background-color: {{ custom_theme.navbar_text_hover }};
        }
        {% endif %}

        {% if custom_theme.navbar_text_hover_focus %}
        .navbar-inverse .navbar-nav > .open > a,
        .navbar-inverse .navbar-nav > .open > a:hover,
        .navbar-inverse .navbar-nav > .open > a:focus {
          background-color: {{ custom_theme.navbar_text_hover_focus }};
        }
        {% endif %}

        {% if custom_theme.navbar_dropdown_menu %}
        .navbar-nav .dropdown-menu {
          background-color: {{ custom_theme.navbar_dropdown_menu }};
          border-top: 1px solid {{ custom_theme.navbar_dropdown_menu }};
        }
        {% endif %}

        {% if custom_theme.navbar_dropdown_menu_text %}
        .navbar-nav .dropdown-menu a {
          color: {{ custom_theme.navbar_dropdown_menu_text }};
        }
        {% endif %}

        {% if custom_theme.navbar_dropdown_menu_hover %}
        .navbar-nav .dropdown-menu li a:hover {
          background-color: {{ custom_theme.navbar_dropdown_menu_hover }};
          color: {{ custom_theme.navbar_dropdown_menu_text }};
        }
        {% endif %}

        {% if custom_theme.navbar_dropdown_menu_divider %}
        .navbar-nav .dropdown-menu .divider {
          background-color: {{ custom_theme.navbar_dropdown_menu_divider }};
        }
        {% endif %}

        {% if custom_theme.logo %}
        .navbar-brand {
          background-image: url({{ custom_theme.logo.url }});
          background-repeat: no-repeat;
          background-position: center;
          background-size: contain;
        }
        {% endif %}

        {% if custom_theme.jumbotron_color %}
        .home .jumbotron {
          background-color: {{ custom_theme.jumbotron_color }}
        }
        {% endif %}

        {% if custom_theme.jumbotron_title_color %}
        .home .jumbotron h1,
        .home .jumbotron h2,
        .home .jumbotron h3 {
          color: {{ custom_theme.jumbotron_title_color }}
        }
        {% endif %}

        {% if custom_theme.jumbotron_text_color %}
        .home .jumbotron p {
          color: {{ custom_theme.jumbotron_text_color }};
          font-weight: normal;
          font-size: xx-large;
          font-family: 'Open Sans','Helvetica Neue',Arial,sans-serif;
        }
        {% endif %}

        {% if custom_theme.jumbotron_welcome_hide %}
        .home .jumbotron .container {
          visibility: hidden;
        }
        {% endif %}

        {% if custom_theme.jumbotron_bg %}
        .home .jumbotron .container {
          position: relative;
          z-index: 1;
        }
        .home .jumbotron:after {
          content: "";
          background-image: url({{ custom_theme.jumbotron_bg.url }});
          background-repeat: no-repeat;
          background-position: center;
          background-size: cover;
          {% if not custom_theme.jumbotron_welcome_hide %}
          opacity: 0.5;
          {% endif %}
          top: 0;
          left: 0;
          bottom: 0;
          right: 0;
          position: absolute;
          z-index: 0;
        }
        {% endif %}

        {% if custom_theme.search_bg_color or custom_theme.search_title_color %}
        .home .big-search {
          background: {{ custom_theme.search_bg_color }};
          color: {{ custom_theme.search_title_color }};
          padding-bottom: 3em;
          padding-top: 1em;
        }
        .home .big-search .btn-default {
          background: transparent;
          border: none;
          color: {{ custom_theme.search_link_color }};
        }
        {% endif %}

        {% if custom_theme.copyright_color %}
        .footer-copyright {
          background-color: {{ custom_theme.copyright_color }};
        }
        {% endif %}

        {% if custom_theme.footer_bg_color or custom_theme.footer_text_color or custom_theme.footer_href_color %}
        footer {
          background-color: {{ custom_theme.footer_bg_color }};
          color: {{ custom_theme.footer_text_color }};
          padding: 1.5em;
        }
        footer a {
          color: {{ custom_theme.footer_href_color }};
        }
        {% endif %}
      </style>
      {% block extra_head %}
      {% endblock %}
    {% endblock %}
    <!--[if IE]>
      <script src="https://html5shim.googlecode.com/svn/trunk/html5.js"></script>
      <style>
        #ieflag{
            display: block !important;
            height: 150px;
            text-align: center;
        }
      </style>
    <![endif]-->
    <link rel="search" type="application/opensearchdescription+xml" href="{% if SITEURL|default:""|slice:"-1:" == "/" %}{{SITEURL}}{% else %}{{SITEURL}}/{% endif %}catalogue/opensearch" title="{% trans "GeoNode Search" %}"/>

    <script>
        var siteUrl = '{{ SITEURL }}'.replace(/\/?$/, '/');
        var staticUrl = '{% static '' %}';
    </script>

    <!-- Autocomplete script for input boxes -->
    <script src="{% static "geonode/js/search/autocomplete.js" %}"></script>

    <script type="text/javascript">
      function thumbnailFeedbacks(data, status) {
        try {
          $("#_thumbnail_feedbacks").find('.modal-title').text(status);
          $("#_thumbnail_feedbacks").find('.modal-body').text(data);
          $("#_thumbnail_feedbacks").modal("show");
        } catch (err) {
          console.log(err);
        } finally {
          return true;
        }
      }
    </script>

    <!-- RTL styles -->
    {% get_current_language_bidi as LANGUAGE_BIDI %}
    {% if LANGUAGE_BIDI %}
        <link rel="stylesheet" href="//cdn.rawgit.com/morteza/bootstrap-rtl/v3.3.4/dist/css/bootstrap-rtl.min.css">
        {% if DEBUG_STATIC %}
          <link rel="stylesheet" type="text/css" href="{% static "geonode/css/geonode-rtl.css" %}">
        {% else %}
          <link rel="stylesheet" type="text/css" href="{% static "geonode/css/geonode-rtl.min.css" %}">
        {% endif %}
    {% endif %}
  </head>

  <body class="{% block body_class %}{% endblock %}">
    <!-- Navbar -->
    {% block header %}
  <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="nav-container">
        <div class="navbar-header">
        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
          <i class="fa fa-navicon fa-lg"></i>
        </button>
        <a class="navbar-brand" href="{% url "home" %}">GeoNode</a>
      </div>
      <div id="navbar" class="navbar-collapse collapse">
        <ul class="nav navbar-nav toolbar">

          {% block tabs %}

          <li id="nav_layers">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{% trans "Data" %}<i class="fa fa-angle-down fa-lg"></i></a>
              <ul class="dropdown-menu">
                <li><a href="{% url "layer_browse" %}?limit={{ CLIENT_RESULTS_LIMIT }}">{% trans "Layers" %}</a></li>
                <li><a href="{% url "document_browse" %}?limit={{ CLIENT_RESULTS_LIMIT }}">{% trans "Documents" %}</a></li>
                <li><a href="{% url "services" %}?limit={{ CLIENT_RESULTS_LIMIT }}">{% trans "Remote Services" %}</a></li>
                {% if user.is_authenticated and not READ_ONLY_MODE %}
                    <li role="separator" class="divider"></li>
                    <li><a href="{% url "layer_upload" %}">{% trans "Upload Layer" %}</a></li>
                    {% if USE_GEOSERVER and CREATE_LAYER %}
                        <li><a href="{% url "layer_create" %}">{% trans "Create Layer" %}</a></li>
                    {% endif %}
                    <li><a href="{% url "document_upload" %}">{% trans "Upload Document" %}</a></li>
                {% endif %}
                {% if user.is_superuser or user.is_staff %}
                  {%  if not READ_ONLY_MODE %}
                    <li><a href="{% url "register_service" %}">{% trans "Add Remote Service" %}</a></li>
                  {% endif %}
                {% endif %}
              </ul>
            </li>
          <li id="nav_maps">
              {% if user.is_authenticated %}
                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{% trans "Maps" %}<i class="fa fa-angle-down fa-lg"></i></a>
                <ul class="dropdown-menu">
                  <li><a href="{% url "maps_browse" %}?limit={{ CLIENT_RESULTS_LIMIT }}">{% trans "Explore Maps" %}</a></li>
                  {% if not READ_ONLY_MODE %}
                    <li> <a href="{% url "new_map" %}">{% trans "Create Map" %}</a></li>
                  {% endif %}
                </ul>
              {% else %}
                <a href="{% url "maps_browse" %}?limit={{ CLIENT_RESULTS_LIMIT }}">{% trans "Maps" %}</a>
              {% endif %}
          </li>
          {% if GEONODE_APPS_ENABLE and GEONODE_APPS_NAV_MENU_ENABLE %}
          <li id="nav_maps">
            {% if user.is_authenticated %}
              <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{% blocktrans %}{{GEONODE_APPS_NAME}}{% endblocktrans %}<i class="fa fa-angle-down fa-lg"></i></a>
              <ul class="dropdown-menu">
                  <li><a href="{% url "apps_browse" %}?limit={{ CLIENT_RESULTS_LIMIT }}">{% trans "Explore" %} {% blocktrans %}{{GEONODE_APPS_NAME}}{% endblocktrans %}</a></li>
                </ul>
            {% else %}
              <a href="{% url "apps_browse" %}?limit={{ CLIENT_RESULTS_LIMIT }}">{% blocktrans %}{{GEONODE_APPS_NAME}}{% endblocktrans %}</a>
            {% endif %}
          </li>
          {% endif %}
          <li>
              <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{% trans "About" %}<i class="fa fa-angle-down fa-lg"></i></a>
              <ul class="dropdown-menu">
                <li><a href="{% url "profile_browse" %}">{% trans "People" %}</a></li>
                <li><a href="{% url "group_list" %}">{% trans "Groups" %}</a></li>
                <li><a href="{% url "group_category_list" %}">{% trans "Group Categories" %}</a></li>
                {% if perms.announcements.can_manage %}
                  <li><a href="{% url "announcements_list" %}">{% trans "Announcements" %}</a></li>
                {% endif %}
                {% if user.is_authenticated and not READ_ONLY_MODE %}
                  <li role="separator" class="divider"></li>
                  <li><a href="{% url "geonode.invitations:geonode-send-invite" %}">{% trans "Invite Users" %}</a></li>
                {% endif %}
                {% if user.is_superuser and not READ_ONLY_MODE %}
                  <li><a href="{% if SITEURL|default:""|slice:"-1:" == "/" %}{{SITEURL}}{% else %}{{SITEURL}}/{% endif %}admin/people/profile/add/">{% trans "Add User" %}</a></li>
                  <li><a href="{% url "group_create" %}">{% trans "Create Group" %}</a></li>
                {% endif %}
              </ul>
          </li>

          {% block extra_tab %}

          {% endblock %}

          {% endblock %}

        </ul>
        <ul class="nav navbar-nav navbar-right">

            {% block my_extra_right_tab %}
               {% render_nav_menu 'TOPBAR_MENU' %}
            {% endblock my_extra_right_tab %}

            <li>
              <div class="search">
                <form id="search" action="{% url "search" %}" >
                  <span class="fa fa-search"></span>
                  <div id="search-container" class="autocomplete-input">
                    {% if HAYSTACK_SEARCH %}
                    <input autocomplete="off" id="search_input" type="text" placeholder="{% trans 'Search' %}" name="q">
                    <input type="hidden" name="abstract__icontains" id="search_abstract_input" placeholder="{% trans 'Search' %}" >
                    <input type="hidden" name="purpose__icontains" id="search_purpose_input" placeholder="{% trans 'Search' %}" >
                    <input type="hidden" name="f_method" id="filtering_type" value="or" >
                    {% else %}
                    <input autocomplete="off" type="text" name="title__icontains" id="search_input" placeholder="{% trans 'Search' %}" >
                    <input type="hidden" name="abstract__icontains" id="search_abstract_input" placeholder="{% trans 'Search' %}" >
                    <input type="hidden" name="purpose__icontains" id="search_purpose_input" placeholder="{% trans 'Search' %}" >
                    <input type="hidden" name="f_method" id="filtering_type" value="or" >
                    {% endif %}
                  </div>
                </form>
              </div>
            </li>
            {% if not user.is_authenticated and ACCOUNT_OPEN_SIGNUP and not READ_ONLY_MODE %}
              <li><a href="{% url "account_signup" %}">{% trans "Register" %}</a></li>
            {% endif %}
            {% if user.is_authenticated %}
            <li>
              <a href="#" class="dropdown-toggle avatar" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
                {% autoescape off %}{% avatar user 40 %}{% endautoescape %}
                {% with full_name=user.first_name|add:' '|add:user.last_name %}
                  {% if full_name.strip %}
                    {{ full_name | truncatechars:20 }}
                  {% else %}
                    {{ user.username | truncatechars:20 }}
                  {% endif %}
                {% endwith %}
                <i class="fa fa-angle-down fa-lg"></i>
              </a>
              <ul class="dropdown-menu">
                <li><a href="{{ user.get_absolute_url }}">{% trans "Profile" %}</a></li>
                <li><a href="{% url "recent-activity" %}">{% trans "Recent Activity" %}</a></li>
                {% if FAVORITE_ENABLED and user.is_authenticated %}
                <li><a href="{% url "favorite_list" %}">{% trans "Favorites" %}</a></li>
                {% endif %}
                <li><a href="{% url "messages_inbox" %}">{% trans "Inbox" %}</a></li>
                {% if user.is_superuser or user.is_staff %}
                    <li role="separator" class="divider"></li>
                    <li><a href="{% url "admin:index" %}">{% trans "Admin" %}</a></li>
                    {% if 'geonode.geoserver' in INSTALLED_APPS %}
                    <li><a href="{{ OGC_SERVER.default.WEB_UI_LOCATION }}">GeoServer</a></li>
                    {% endif %}
                    {% if USE_MONITORING %}
                    <li role="separator" class="divider"></li>
                    <li><a href="{% url "monitoring:index" %}">{% trans "Monitoring & Analytics" %}</a></li>
                    {% endif %}
                {% endif %}
                <li role="separator" class="divider"></li>
                <li><a href="{% url "help" %}">{% trans "Help" %}</a></li>
                <li role="separator" class="divider"></li>
                <li><a href="{% if SITEURL|default:""|slice:"-1:" == "/" %}{{SITEURL}}{% else %}{{SITEURL}}/{% endif %}account/logout/">{% trans "Log out" %}</a></li>
                </ul>
              </li>
          {% else %}
          <li><a href="#" data-toggle="modal" data-target="#SigninModal" role="button" >{% trans "Sign in" %} </a></li>
              {% endif %}
            </ul>
          </div> <!--/.nav-collapse -->
        </div>
      </nav>
      {% endblock header %}
      <!-- End of Navbar -->

    <div class="alert alert-danger alert-dismissible" role="alert" id="ieflag" style="display:none">
      <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
      <h1>{% trans "You are using an outdated browser that is not supported by GeoNode." %}</h1>
      <p>{% trans "Please use a <strong>modern browser</strong> like Mozilla Firefox, Google Chrome or Safari." %}</p>
    </div>

  <div id="wrap">
    {% block middle %}
    <div class="container">
      {% include "_status_message.html" %}
      {% include "_announcements.html" %}
      {% include "_messages.html" %}
      {% block body_outer %}
      <div class="row">
        <div class="col-md-8">
        {% block body %}{% endblock %}
        </div>
        <div class="col-md-4">
        {% block sidebar %}{% endblock %}
        </div>
      </div>
      {% endblock %}
    </div>
    {% endblock middle %}

    {% block extra_mainbody %}
    {% endblock extra_mainbody %}

  </div>

  {% block monitoring %}
  {% endblock %}

  {% block footer %}
  <footer>
    <div class="container">
      <div class="row">
        <div class="col-md-2">
          <ul class="list-unstyled">
            <li>{% trans "Data" %}</li>
            <li><a href="{% url "layer_browse" %}?limit={{ CLIENT_RESULTS_LIMIT }}">{% trans "Layers" %}</a></li>
            <li><a href="{% url "document_browse" %}?limit={{ CLIENT_RESULTS_LIMIT }}">{% trans "Documents" %}</a></li>
            <li><a href="{% url "services" %}?limit={{ CLIENT_RESULTS_LIMIT }}">{% trans "Remote Services" %}</a></li>
            {% if user.is_authenticated and not READ_ONLY_MODE %}
                <li role="separator" class="divider"></li>
                <li><a href="{% url "layer_upload" %}">{% trans "Upload Layer" %}</a></li>
                {% if USE_GEOSERVER and CREATE_LAYER %}
                    <li><a href="{% url "layer_create" %}">{% trans "Create Layer" %}</a></li>
                {% endif %}
                <li><a href="{% url "document_upload" %}">{% trans "Upload Document" %}</a></li>
            {% endif %}
            {% if user.is_staff or user.is_superuser %}
              {% if not READ_ONLY_MODE %}
                <li><a href="{% url "register_service" %}">{% trans "Add Remote Service" %}</a></li>
              {% endif %}
            {% endif %}
          </ul>
        </div>
        <div class="col-md-2">
          <ul class="list-unstyled">
            <li>{% trans "Maps" %}</li>
            <li><a href="{% url "maps_browse" %}?limit={{ CLIENT_RESULTS_LIMIT }}">{% trans "Explore Maps" %}</a></li>
            {% if user.is_authenticated and not READ_ONLY_MODE %}
              <li> <a href="{% url "new_map" %}">{% trans "Create Map" %}</a></li>
            {% endif %}
          </ul>
        </div>
        <div class="col-md-2">
          <ul class="list-unstyled">
            <li>{% trans "About" %}</li>
            <li><a href="{% url "profile_browse" %}">{% trans "People" %}</a></li>
            <li><a href="{% url "group_list" %}">{% trans "Groups" %}</a></li>
            {% if perms.announcements.can_manage %}
            <li><a href="{% url "announcements_list" %}">{% trans "Announcements" %}</a></li>
            {% endif %}
            {% if user.is_authenticated and not READ_ONLY_MODE %}
            <li><a href="{% url "geonode.invitations:geonode-send-invite" %}">{% trans "Invite Users" %}</a></li>
            {% endif %}
            {% if user.is_superuser and not READ_ONLY_MODE %}
            <li><a href="{% if SITEURL|default:""|slice:"-1:" == "/" %}{{SITEURL}}{% else %}{{SITEURL}}/{% endif %}admin/people/profile/add/">{% trans "Add User" %}</a></li>
            <li><a href="{% url "group_create" %}">{% trans "Create Group" %}</a></li>
            {% endif %}
          </ul>
        </div>

        <div class="col-md-6 text-right">
          {% block contactus %}
          {% if custom_theme.contactus %}
          <ul class="list-unstyled">
              <li style="text-align: left;"><h2 style="margin-top: 0px;">{% trans "Contact Us" %} </h2> </li>
              {% if custom_theme.contact_name %}<li style="text-align: left;">{{ custom_theme.contact_name }}</li>{% endif %}
              {% if custom_theme.contact_position %}<li style="text-align: left;">{{ custom_theme.contact_position }}</li>{% endif %}
              {% if custom_theme.contact_administrative_area %}<li style="text-align: left;">{{ custom_theme.contact_administrative_area }}</li>{% endif %}
              {% if custom_theme.contact_city %}<li style="text-align: left;">{{ custom_theme.contact_city }}</li>{% endif %}
              {% if custom_theme.contact_street %}<li style="text-align: left;">{{ custom_theme.contact_street }}</li>{% endif %}
              {% if custom_theme.contact_postal_code %}<li style="text-align: left;">{{ custom_theme.contact_postal_code }}</li>{% endif %}
              {% if custom_theme.contact_country %}<li style="text-align: left;">{{ custom_theme.contact_country }}</li>{% endif %}
              {% if custom_theme.contact_delivery_point %}<li style="text-align: left;">{{ custom_theme.contact_delivery_point }}</li>{% endif %}
              {% if custom_theme.contact_voice %}<li style="text-align: left;">{% trans "Tel" %}: {{ custom_theme.contact_voice }}</li>{% endif %}
              {% if custom_theme.contact_facsimile %}<li style="text-align: left;">{% trans "Fax" %}: {{ custom_theme.contact_facsimile }}</li>{% endif %}
              {% if custom_theme.contact_email %}<li style="text-align: left;">{% trans "E-mail" %}: {{ custom_theme.contact_email }}</li>{% endif %}
          </ul>
          {% endif %}
          {% endblock contactus %}
          <ul class="list-unstyled">
            <li>{% trans "Powered by" %} <a href="http://geonode.org">{% trans "GeoNode" %}</a>{% if user.is_staff %} <em>{% trans "version" %} {{ VERSION }}</em>{% endif %}</li>
            <li><a href="{% url "developer" %}">{% trans "Developers" %}</a> | <a href="{% url "about" %}">{% trans "About" %}</a><li>
          </ul>
          <label class="hidden">{% trans "Language" %}</label>
          {% if csrf_token != "NOTPROVIDED" %}
          {% get_current_language as LANGUAGE %}
          <form class="form-inline" action="/i18n/setlang/" method="post">
          {% csrf_token %}
            <select class="col-md-6 pull-right" name="language" onchange="javascript:form.submit()">
              {% for lang in LANGUAGES %}
              <option value="{{ lang.0 }}" {% ifequal LANGUAGE_CODE lang.0 %} selected="selected"{% endifequal %}>
                {{ lang.1 }}
              </option>
              {% endfor %}
            </select>
          </form>
          {% endif %}
        </div>
      </div>
    </div>
  </footer>

  {% if custom_theme.copyright %}
    <section class="footer-copyright">
      <div class="container">
        <div class="row">
          <div class="col-md-12 copyright ">
            <div class="module">
              <small>{{ custom_theme.copyright|safe }}</small>
            </div>
          </div>
        </div>
      </div>
    </section>
  {% endif %}

  {% endblock footer %}


    <!-- Modal must stay outside the navbar -->
    {% if not user.is_authenticated %}
    <div class="modal fade" id="SigninModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog modal-sm">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">{% trans "Close" %}</span></button>
            <h4 class="modal-title" id="myModalLabel">{% trans "Sign in" %}</h4>
          </div>
          <form class="form-signin" role="form" action="{% url "account_login" %}?next={{ request.path }}" method="post">
            <div class="modal-body">
              {% csrf_token %}
              {% get_providers as socialaccount_providers %}
              {% if socialaccount_providers %}
                  {% include "socialaccount/snippets/provider_list.html" with process="login" %}
                  {% include "socialaccount/snippets/login_extra.html" %}
                <hr>
              {% endif %}
              <div class="form-group">
                <label for="id_username" class="sr-only">{% trans "Username" %}:</label>
                <input id="id_username" class="form-control" name="login" placeholder="{% trans "Username" %}" type="text" />
              </div>
              <div class="form-group">
                <label for="id_password" class="sr-only">{% trans "Password" %}:</label>
                <input id="id_password" class="form-control" name="password" placeholder="{% trans "Password" %}" type="password" autocomplete="off" />
              </div>
              <label class="checkbox">
                <input type="checkbox" /> {% trans "Remember Me" %}
              </label>
              <p>
                <a href="{% url 'account_reset_password' %}">{% trans "Forgot Password?" %}</a>
              </p>
            </div>
            <div class="modal-footer">
              <button type="submit" class="btn btn-primary btn-block">{% trans "Sign in" %}</button>
            </div>
          </form>
        </div>
      </div>
    </div>
    {% endif %}
    <!-- End of Modal -->

    {% if DEBUG_STATIC %}
    <script src="{% static "lib/js/jquery.js" %}"></script>
    <script src="{% static "lib/js/jquery.dataTables.js" %}"></script>
    <script src="{% static "lib/js/bootstrap-treeview.js" %}"></script>
    <script src="{% static "lib/js/bootstrap-tokenfield.js" %}"></script>
    <script src="{% static "lib/js/fastselect.standalone.js" %}"></script>
    <script src="{% static "lib/js/select2.full.js" %}"></script>
    <script src="{% static "lib/js/jquery.timeago.js" %}"></script>
    <script src="{% static "lib/js/jq-ajax-progress.js" %}"></script>
    <script src="{% static "lib/js/jquery-ui.js" %}"></script>
    <script src="{% static "lib/js/jquery.raty.js" %}"></script>
    <script src="{% static "lib/js/bootstrap.js" %}"></script>
    <script src="{% static "lib/js/moment-with-locales.js" %}"></script>
    <script src="{% static "lib/js/bootstrap-datetimepicker.js" %}"></script>
    <script src="{% static "lib/js/json2.js" %}"></script>
    <script src="{% static "lib/js/waypoints.js" %}"></script>
    <script src="{% static "lib/js/underscore.js" %}"></script>
    {% else %}
    <script src="{% static "lib/js/assets.min.js" %}"></script>
    {% endif %}
    <script src="{% static "geonode/js/utils/utils.js" %}"></script>
    <script src="{% static "geonode/js/base/base.js" %}"></script>
    <script type="text/javascript" src="{% url "javascript-catalog" %}"></script>
    {% block extra_script %}{% endblock extra_script %}
    <script type="text/javascript">

      // Autocomplete instance for the search found in the header.
      $(document).ready(function() {
        window.autocomplete2 = new Autocomplete({
          form_btn: null,
          form_submit: '#search',
          form_selector: '#search',
          input_selector: '#search_input',
          container_selector: '#search-container',
          url: '{% url "autocomplete_base" %}'
        })
        window.autocomplete2.setup()
      })

      $('#search').on('submit', (e) => {
          $('#search_abstract_input')[0].value =$('#search_input')[0].value;
          $('#search_purpose_input')[0].value = $('#search_input')[0].value;
      });

      $(window).on('load', function() {
          setTimeout(() => {
              document.body.scrollTop = 0;
              document.documentElement.scrollTop = 0;
          });
        });

      $(".datepicker").datepicker({
          format: "yyyy-mm-dd"
      });
    </script>

    <div class="modal fade" style="width: 100%; height: 100%;" id="_resource_uploading" data-backdrop="static" data-keyboard="false" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h1>{% trans "Uploading..." %}</h1>
                </div>
                <div class="modal-body">
                    <div class="progress">
                      <div class="progress-bar progress-bar-info progress-bar-striped active" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width:100%">
                        {% trans "Upload in progress..." %}
                      </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="modal fade" style="width: 100%; height: 100%;" id="_thumbnail_processing" data-backdrop="static" data-keyboard="false" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h1>{% trans "Processing..." %}</h1>
                </div>
                <div class="modal-body">
                    <div class="progress">
                      <div class="progress-bar progress-bar-info progress-bar-striped active" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width:100%">
                        {% trans "Updating Thumbnail..." %}
                      </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="modal fade" id="_thumbnail_feedbacks" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog" role="document">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <h4 class="modal-title" id="exampleModalLabel">{% trans "Message box" %}</h4>
          </div>
          <div class="modal-body">
            ...
          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal">{% trans "OK" %}</button>
          </div>
        </div>
      </div>
    </div>

    <div id="confirmMsgBoxModalOK" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <!-- How to use it:
        $("#confirmMsgBoxModalOK").find('.modal-title').text('{% trans "Title" %}');
        $("#confirmMsgBoxModalOK").find('.modal-body').text('{% trans "Message. Do you want to proceed?" %}');
        $("#confirmMsgBoxModalOK_control_field").val('your_control_value');
        $("#confirmMsgBoxModalOK").modal("show");

        $('#confirmMsgBoxModalOK').find('.modal-footer #confirm').on('click', function() {
          if ($("#control_field").val() == 'your_control_value') {
            CONFIRMED
          }
        });
      -->
      <div class="modal-dialog">
        <input type="hidden" class="form-control" id="confirmMsgBoxModalOK_control_field" />
        <div class="modal-content panel-success">
          <div class="modal-header panel-heading">
            <button type="button" class="close" data-dismiss="modal">&times;</button>
            <h4 class="modal-title">{% trans "Confirm" %}</h4>
          </div>
          <div class="modal-body">
            <p>{% trans "Some text in the modal" %}.</p>
          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Cancel" %}</button>
            <button type="button" class="btn btn-danger confirm" id="confirm">{% trans "OK" %}</button>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>
